#pragma once
#include <stdint.h>
#ifdef WIN32
#include <winsock2.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#endif
#include <ws2tcpip.h>
#include <wspiapi.h>
#include <tchar.h>

#pragma comment(lib,"ws2_32.lib")

class NetInitialized
{
public:
	NetInitialized()
	{
#ifdef WIN32
		m_wVersionRequested = MAKEWORD(2, 2);
		WSAStartup(m_wVersionRequested, &m_wsaData);
#endif
	}

	~NetInitialized()
	{
#ifdef WIN32
		WSACleanup();
#endif
	}

private:
#ifdef WIN32
	WORD m_wVersionRequested;
	WSADATA m_wsaData;
#endif
};

